package com.orhon.smartcampus.modules.base.mm;


import com.orhon.smartcampus.basicComponents.GQLLang;
import com.orhon.smartcampus.modules.base.entity.TextbookChapters;
import com.orhon.smartcampus.modules.base.entity.Textbooks;
import com.orhon.smartcampus.modules.base.gqlModel.GQLTextbookChapters;
import com.orhon.smartcampus.modules.base.gqlModel.GQLTextbooks;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(
        uses = {
                LangMapper.class,
        }
)
public interface TextbookChapterMapper {

    TextbookChapterMapper MAPPER = Mappers.getMapper(TextbookChapterMapper.class);

    @Mapping(source = "id" , target = "id")
    @Mapping(source = "textbookId" , target = "textbookId")
    @Mapping(source = "parentId" , target = "parentId")
    @Mapping(source = "chapterOrder" , target = "chapterOrder")
    @Mapping(source = "chapterType" , target = "chapterType")
    @Mapping(source = "mark" , target = "mark")
    @Mapping(source = "chapterName" , target = "chapterName")
    GQLTextbookChapters toTextbookChapter(TextbookChapters entity);
    
    @InheritConfiguration(name = "toTextbookChapter")
    List<GQLTextbookChapters> toTextbookChapterList(List<TextbookChapters> entities);
}
